﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Security;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace WcfService
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the interface name "IService1" in both code and config file together.
    [ServiceContract]
    public interface IWcfCinemaService
    {
        #region Movie
        [OperationContract]
        List<Movie> ReadMovie(string title);
        [OperationContract]
        Movie ReadMovieById(int id);
        [OperationContract]
        List<Movie> ReadAllMovies();
        [OperationContract]
        int InsertMovie(Movie movie);
        [OperationContract]
        int UpdateMovie(Movie movie);
        [OperationContract]
        List<Movie> DateMovie(String date);
        [OperationContract]
        int DeleteMovie(int id);
        [OperationContract]
        Movie MovieObject(int id, string title, string description, double price, bool is3d, int length, int commercials, int trailer, string image);
        #endregion

        #region Seat
        [OperationContract]
        Seat ReadSeat(int id);
        [OperationContract]
        List<Seat> ReadAllSeats(int room);
        [OperationContract]
        void InsertSeat(Seat seat);
        [OperationContract]
        void UpdateSeat(Seat seat);
        [OperationContract]
        void DeleteSeat(Seat seat);
        [OperationContract]
        Seat SeatObject(int row, int seatNumber, double price, bool handicap, bool legspace, int room);
        #endregion

        #region Ticket
        [OperationContract]
        List<Ticket> ReadAllTicket();
        [OperationContract]
        List<Ticket> ReadTicket(Booking booking);
        [OperationContract]
        List<Ticket> ReadTicketByShowTime(ShowTime showtime);
        [OperationContract]
        List<Ticket> ReadAllTickets(int id);
        [OperationContract]
        void InsertTicket(Ticket tick);
        [OperationContract]
        Ticket TicketObject(double ticketPrice, ShowTime showTime, Seat seat, Booking booked);
        #endregion

        #region ShowTime
        [OperationContract]
        ShowTime ReadShowTime(int id);
        [OperationContract]
        List<ShowTime> DateShowTimes(string date);
        [OperationContract]
        List<ShowTime> ReadShowTimeByMovie(Movie mov);
        [OperationContract]
        List<ShowTime> ReadShowTimeByRoom(CinemaRoom room);
        [OperationContract]
        List<ShowTime> ReadShowTimeByDate(DateTime date);
        [OperationContract]
        List<ShowTime> ReadShowTimeByShowtime(ShowTime sht);
        [OperationContract]
        int GetShowTimeID(ShowTime sht);
        [OperationContract]
        List<ShowTime> ReadAllShowTimes();
        [OperationContract]
        void InsertShowTime(ShowTime showTime);
        [OperationContract]
        void UpdateShowTime(ShowTime newTime, ShowTime oldTime);
        [OperationContract]
        void DeleteShowTime(ShowTime showTime);

        [OperationContract]
        ShowTime ShowTimeObject(DateTime date, Movie movie, double price, CinemaRoom room);
        #endregion

        #region Employee
        [OperationContract]
        List<Employee> ReadEmployee(string fname, string lname, string phone);
        [OperationContract]
        int InsertEmployee(Employee emp);
        [OperationContract]
        int DeleteEmployee(int id);
        [OperationContract]
        int UpdateEmployee(Employee emp);
        
        [OperationContract]
        Employee EmployeeObject(string phoneNo, string lname, string fname, bool isadmin, int id, bool isactive, List<Booking> bookings);
        #endregion

        #region Customer
        [OperationContract]
        List<Customer> ReadCustomer(string phoneNumber);
        [OperationContract]
        List<Customer> ReadAllCustomers();
        [OperationContract]
        int InsertCustomer(Customer cust);
        [OperationContract]
        int DeleteCustomer(string phoneNumber);
        [OperationContract]
        Customer CustomerObject(string phoneNo, string name, string email, Booking booked);
        #endregion

        #region CinemaRoom
        [OperationContract]
        CinemaRoom ReadCinemaRoom(int id);
        [OperationContract]
        List<CinemaRoom> ReadAllCinemaRooms();
        [OperationContract]
        int InsertCinemaRoom(CinemaRoom room);
        [OperationContract]
        int UpdateCinemaRoom(CinemaRoom room);
        [OperationContract]
        int DeleteCinemaRoom(int id);
        [OperationContract]
        CinemaRoom CinemaRoomObject(int id, string screen, int maxSeats, int maxLengthSeats, List<Seat> seats, List<ShowTime> shows, int amount);
        #endregion

        #region Booking
        [OperationContract]
        Booking ReadBookingById(int id);
        [OperationContract]
        List<Booking> ReadBooking(Customer customer);
        [OperationContract]
        int InsertBooking(Booking booking);
        [OperationContract]
        int UpdateBooking(Booking booking);
        [OperationContract]
        int BookingMaxID();
        [OperationContract]
        void CheckBooking();

        [OperationContract]
        Booking BookingObject(int id, double totalprice, int status, string customerphone);

        [OperationContract]
        Booking CreateBooking(List<Ticket> tickets, Customer customer, int status);

        [OperationContract]
        Booking CreateBookingFromSeats(ShowTime showTime, List<Seat> seats, Customer customer);
        #endregion

        #region BookingList

        [OperationContract]
        List<Seat> ReservedListGet(ShowTime showTime);

        [OperationContract]
        List<Seat> ReservedListAdd(ShowTime showTime, Seat seat);

        [OperationContract]
        void ReservedListRemove(ShowTime showTime, Seat seat);

        [OperationContract]
        void ReservedListPopulate(ShowTime showTime);

        
        #endregion
    }
}
